<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>houdunren.com</h1>
    <h1>hdcms.com</h1>
    <script>
      function element(tag) {
        const html = document.body.innerHTML;
        let reg = /<(" + tag + ")>.+<\/\1>/g;
        return html.match(reg);
      }
      console.log(element('h1'));
    </script>
  </body>
</html>
